package com.bookmanager.www.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author 风离
 * @since 2021-09-17
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class FlUser implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户唯一id
     */
    private String userId;

    /**
     * 权限外键
     */
    private Integer permissionsId;

    /**
     * 角色外键
     */
    private Integer roleId;


    /**
     * 用户性别 默认男
     */
    private Integer userSex;

    /**
     * 用户头像
     */
    private String avatar;

    /**
     * 用户名
     */
    private String username;

    /**
     * 用户密码

     */
    private String password;

    /**
     * 用户个性签名？？
     */
    private String description;

    /**
     * 用户手机号
     */
    private String contactInformation;

    /**
     * 用户状态（0正常 1 禁封）
     */
    private Integer accountStatus;

    /**
     * 用户邮箱 后期可通过邮箱登录
     */
    private String email;

    /**
     * 用户找回密码
     */
    private String question;

    /**
     * 找回密码的答案
     */
    private String answer;

    /**
     * 用户余额
     */
    private BigDecimal accountBalance;

    /**
     * 用户等级 0 普通用户 1会员用户 2超级会员用户
     */
    private int accountLevel;

    /**
     * 用户累计充值
     */
    private BigDecimal cumulativeRecharge;

    /**
     * 用户累计消费
     */
    private BigDecimal cumulativeConsumption;


    /**
     * 用户信息创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 用户信息修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    public FlUser(String userId, Integer permissionsId, Integer roleId, Integer userSex, String avatar, String username, String password, String description, String contactInformation, Integer accountStatus, String email, String question, String answer, BigDecimal accountBalance, int accountLevel, LocalDateTime createTime, LocalDateTime updateTime) {
        this.userId = userId;
        this.permissionsId = permissionsId;
        this.roleId = roleId;
        this.userSex = userSex;
        this.avatar = avatar;
        this.username = username;
        this.password = password;
        this.description = description;
        this.contactInformation = contactInformation;
        this.accountStatus = accountStatus;
        this.email = email;
        this.question = question;
        this.answer = answer;
        this.accountBalance = accountBalance;
        this.accountLevel = accountLevel;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }
}
